<?php		




class NsiteMod extends ModBase{

	private $api = null;

	/**
	 * 构造函数，初始化插件
	 */
	public function __construct() {
		if(!n_api('passport')->islogin()){
			n_go(n_url('passport','login'));
		}
		$this->api = n_api("nsite");
	}

	public function memberSite($ppid,$pevent,$paction){
		$rs['pevent'] = $pevent;
		$rs['paction'] = $paction;	
		$rs['data'] = n_api("nsite")->getMemberSite($ppid);
		$this->_html("memberSiteMod",$rs);
		
	}
	
	public function getCurrentPlugins($scode){
		if('antidataedit'==N_EVENT.N_ACTION)return '';
		$mysql = n_api("mysql")->db001;
		
		$rs['info'] = $this->api->getByScode($scode);
		//$rs['plugins'] = n_api('pbox')->getSitePlugins($rs['info']['id']);

		$this->_html("getCurrentPlugins",$rs);
	}
	
	public function getMySite(){
		$param = $this->param("scode:char:ignore");
		
		$rs = n_api('nsite')->getMySite($_SESSION['ppid']);
		$rs['scode'] = $param['scode'];
		
		$this->_html("getMySite",$rs);
	}
}